package se.thoka.twt.shared.item;

import java.util.Collection;

import se.thoka.twt.shared.exceptions.IllegalOperationException;
import se.thoka.twt.shared.exceptions.NoSuchObjectException;
import se.thoka.twt.shared.utils.HasId;

import com.google.gwt.user.client.rpc.RemoteService;

public interface ItemService<T extends HasId> extends RemoteService {

	T insert(T entity) throws IllegalOperationException;
	
	T update(T entity) throws IllegalOperationException, NoSuchObjectException;
	
	void delete(T entity) throws IllegalOperationException;
	
	Collection<T> selectAll() throws IllegalOperationException;
	
	T selectById(String id) throws IllegalOperationException, NoSuchObjectException;
}
